﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using mendian;
using Luna小店.DTO;
using DevExpress.XtraGrid.Demos.util;
using DevExpress.XtraEditors.Filtering.Templates;
using Luna小店.UC.面料库存.盘点.service;
using Luna小店.UC.面料库存.库存记录.service;

namespace Luna小店.UC.面料库存
{
    public partial class Frm领料出库 : DevExpress.XtraBars.Ribbon.RibbonForm
    {
        public StockOutEntryDTO StockOutEntryDTO;
        private List<DTO采购分录> DTO出库分录s = new List<DTO采购分录>();
        public Frm领料出库()
        {
            InitializeComponent();
        }

        private void barButtonItem2_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            Frm出库面料选择 frm = new Frm出库面料选择();
            frm.ShowDialog();
            if (null == frm.DTO采购分录)
            {
                return;
            }
            this.DTO出库分录s.Add(frm.DTO采购分录);
            this.gridControl出库.DataSource = this.DTO出库分录s;
            this.gridView出库.RefreshData();
            
        }

        private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            StockOutDTO StockOutDTO = new StockOutDTO(
                this.dateTimePicker1.Value,
                this.DTO出库分录s
                );
            //webservice传值
            盘点Service.post盘亏出库(StockOutDTO);
            MessageBox.Show("领料出库成功");
        }
    }

    
}